#ifndef BinaryBoard_H
#define BinaryBoard_H


#include "NumBoard.h"

namespace HitoriGenerator {
class BinaryBoard : public NumBoard{
public:
	BinaryBoard();
	BinaryBoard(const unsigned short rows, const unsigned short columns, bool isEmpty = false);
	~BinaryBoard();
	
	unsigned short get_cell(const unsigned short index) const;
	void set_cell(const unsigned short index, const unsigned short value);
	bool check_adjacent(const unsigned short index) const;
	bool check_diagonal(const unsigned short index) const;
	void show();
	

private:
	std::unique_ptr<std::vector<unsigned short>> cell, state0;
	
	void __renew();
	void __toggle(const unsigned short index);
	void __toggle_marked(const unsigned short index);
	void __toggle_safe(const unsigned short index);
	void __toggle_adjacent(const unsigned short index);
	void __toggle_diagonal(const unsigned short index);
	bool __qcheck_diagonal(const unsigned short index);
	unsigned short __count_border(const unsigned short index, const unsigned short offset, const unsigned short origin) const;
	
	bool __is_solved() const;
};
}


#endif